gusucode.com > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM源码程序 > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM\stprtool\generalp\normald.m
function [p]=normald(X,mi,sigma) % [p]=normald(X,mi,sigma) % % NORMALD calculates the value of many-dimensional probability density % of the normal (Gaussian) distribution for given vectors in the % matrix X and parameters of the normal distribution mi, sigma. % % Input: % x [NxK] - matrix K of input vectors for which the density is calculated % mi [Nx1] - vector of mean values % sigma [NxN] - covariance matrix % % where N is the dimension of the feature space. % % Output: % p[1xK] - the value of the probability density % % Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac % (c) Czech Technical University Prague, http://cmp.felk.cvut.cz % Written Vojtech Franc (diploma thesis) 19.03.2000 % Modifications % 24. 6.00 V. Hlavac, comments changed to English. DIM=size(X,1); p=exp(-1/2*mahalan(X,mi,sigma))/((2*pi)^(DIM/2) * sqrt(det(sigma)));